import { RouteRecordRaw } from "vue-router";

const basicRoute = (routes: RouteRecordRaw[]) => ([
    {
        path: "/",
        redirect: "/i"
    },
    {
        path: "/i",
        component: () => import("@/views/index.vue"),
        children: [
            ...routes
        ]
    },
    {
        path: "/s",
        redirect: "/s/error",
        component: () => import("@/views/system/index.vue"),
        children: [
            {
                path: "maintenance",
                name: "maintenance",
                component: () => import("@/views/system/src/maintenance/index.vue")
            },
            {
                path: "error",
                name: "error",
                component: () => import("@/views/system/src/error/index.vue")
            },
            {
                path: "notFound",
                name: "notFound",
                component: () => import("@/views/system/src/not-found/index.vue")
            }
        ]
    },
    {
        path: "/:pathMatch(.*)*",
        name: "NotFound",
        component: () => import("@/views/system/src/not-found/index.vue")
    }
] as RouteRecordRaw[]);

export default basicRoute;
